import { request, config } from '../utils'
import * as commonService from "./common";

const { api: {contractCancelApply} } = config;

export async function query(params = {}) {
  params.apiBaseUrl = `${contractCancelApply}/canceling`;
  return commonService.commonQuery(params);
}

export async function canceledList(params = {}) {
  params.apiBaseUrl = `${contractCancelApply}/canceled`;
  return commonService.commonQuery(params);
}

export async function accept (params) {
  const url = `${contractCancelApply}/acceptCancelApply`
  return request({url: url, method: 'POST', data: params})
}

export async function deny (params) {
  const url = `${contractCancelApply}/denyCancelApply`
  return request({url: url, method: 'POST', data: params})
}

/**
 *
 * @param params
 * @returns {Promise<*>}
 */
export async function create (params) {
  const url = `${contractCancelApply}/create`
  return request({url: url, method: 'POST', data: params})
}
